using System.Text.RegularExpressions;
using SharpArch.Core.NHibernateValidator;

namespace ETestIT.Core
{
    using NHibernate.Validator.Constraints;
    using SharpArch.Core.DomainModel;

    [HasUniqueDomainSignature]
    public class User : Entity
    {
        public User()
        {
        }

        public User(string name, string password)
        {
            Name = name;
            Password = password;
        }

        [DomainSignature]
        [NotNullNotEmpty]
        [Length(3,32)]
        [Pattern(@"\w", RegexOptions.Compiled, "spaces are not allowed as value")]
        public virtual string Name { get; set; }

        [NotNullNotEmpty]
        [Length(3, 32)]
        public virtual string Password { get; set; }
    }
}